package cn.tedu.v1.vo;

import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@Accessors(chain = true)
public class RegisterVo implements Serializable {
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^.{2,20}$",message = "用户名是2~20位字符")
    private String username;

    @NotBlank(message = "email不能为空")
    @Pattern(regexp = "^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$",message = "邮箱格式不正确")
    private String email;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,20}$",message = "密码是6~20位字符")
    private String password;

    @NotBlank(message = "确认密码不能为空")
    private String confirm;
}
